package priv.yiyuan.example.design.export;

import java.util.List;

/**
 * 报表
 * <p>
 * 桥接模式-抽象部分
 */
public abstract class Report {

    protected String title;

    protected List<String> data;

    protected ExportFormat exportFormat;

    public Report(ExportFormat exportFormat) {
        this.exportFormat = exportFormat;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setData(List<String> data) {
        this.data = data;
    }

    public abstract String generate();

    public String export() {
        return exportFormat.export(generate());
    }
}
